Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
time-limit-promise
Advanced tools
Fulfill long runinng promises on timeout.
Unlike other implementations on npm it has some nice extra features:
Promise
implementation of the passed promise: no external implementation dependencies, no global Promise
dependenciesnpm install time-limit-promise
const timeLimit = require('time-limit-promise');
const fetch = require('node-fetch');
var fetchPromise = fetch('https://github.com/inikulin');
timeLimit(fetchPromise, 50).then(res => {
// If `fetchPromise` will be fulfilled within 50ms
// time limited promise will be fullfilled as well.
// Otherwise, it will be resolved with the `undefined` value.
});
timeLimit(fetchPromise, 50, { resolveWith: 'no content' }).then(res => {
// Same as above, but on timeout it will
// be resolved with the `no-content` value.
console.log(res); // > no-content
});
timeLimit(fetchPromise, 50, { rejectWith: new Error('timeout') }).catch(err => {
// Same as above, but on timeout it will
// be rejected with the provided error.
console.log(err.message); // > timeout
});
FAQs
Fulfill long runinng promises on timeout.
We found that time-limit-promise demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.